home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / pc_board / pcbss30.zip / SS.DOC < prev    next >
Text File  |  1992-11-23  |  73KB  |  1,761 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                             PCBSuperScript v3.0
  22.                            ─────────────────────
  23.                               ───────────────
  24.                                  ─────────
  25.                                     ───
  26.                                      ─
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.      Copyright (c) 1990-1992 by Chris Curran and Aquila Data Systems, Inc.
  55.                             All rights reserved.
  56.  
  57.        All trademarks and copyrights belong to their respective holders.
  58.   
  59.  
  60.   Products Used
  61.   -----------------------------------------------------------------------------
  62.  
  63.       C compiler     : Borland C++ v3.1  (Borland)
  64.       Assembler      : TASM v3.0         (Borland)
  65.       Linker         : TLink v5.1        (Borland)
  66.       Debugger       : TDebug v3.0       (Borland)
  67.       Version Control: PVCS for DOS      (Sage Software)
  68.       Editor         : QEdit 2.15        (SemWare)
  69.  
  70.  
  71.  
  72.  
  73.   Disclaimer
  74.   -----------------------------------------------------------------------------
  75.  
  76.       The author hereby disclaims all warranties relating to this product,
  77.     whether express or implied, including without limitation any implied
  78.     warranties of merchantability or fitness for a particular purpose. The
  79.     author cannot and will not be liable for any special, incidental,
  80.     consequential, indirect or similar damages due to loss of data or any
  81.     other reason, even if the author or an authorized agent has been advised
  82.     of the possibility of such damages.  In no event shall the liability for
  83.     any damages ever exceed the price paid for the license to use the
  84.     software, regardless of the form and/or extent of the claim.  The user of
  85.     this program bears all risk as to the quality and performance of the
  86.     software.
  87.  
  88.  
  89.  
  90.   License
  91.   -----------------------------------------------------------------------------
  92.  
  93.       PCBSuperScript is a Shareware product.  As such, it is made available
  94.     to the general personal computing public for evaluation. Users are
  95.     licensed to operate this program on their personal computers for the
  96.     purpose of test and evaluation on a trial basis for a limited trial
  97.     period.  It is not possible to reasonably define the limits of a fair and
  98.     equitable time period for evaluation; therefore it is left to the user's
  99.     judgment and sense of fair play as to the time required to make a
  100.     decision as to its usefulness. If the user decides the program is not of
  101.     sufficient merit to warrant purchase through registration with the
  102.     author, he/she should remove the program from his/her personal computer.
  103.     Otherwise, if the program is deemed useful and is in regular use on the
  104.     user's computer system, registration with the author is required.
  105.  
  106.       Registered users are those users who elect to pay for PCBSuperScript
  107.     and register that payment with the author.  By virtue of registration and
  108.     payment for the program, registered users are granted a license to
  109.     continue to utilize the program on their personal computer for as long as
  110.     they choose.  This license authorizes the user to use the program on any
  111.     personal computer system he or she may own or use so long as the program
  112.     is operated on only one computer system at a time.
  113.  
  114.  
  115.   Guarantee
  116.   -----------------------------------------------------------------------------
  117.  
  118.       PCBSuperScript is offered with an unconditional 30-day money-back
  119.     guarantee.  If you become dissatisfied with the program for any reason
  120.     within that period, just let me know and your registration fee will be
  121.     refunded.  If you purchased a registration package which included a
  122.     diskette and/or a manual, please return these when requesting a refund.
  123.  
  124.       This guarantee is unconditional.  I would ask, however, if you are
  125.     having a problem to let me know before giving up on PCBSuperScript since
  126.     your problem may be something I can solve.
  127.  
  128.       Finally, if you order a registration package which includes a diskette
  129.     or manual and either of these items are defective -- either through my
  130.     error or through postal service "processing", let me know and I will send
  131.     replacements promptly.
  132.  
  133.  
  134.  
  135.   Registration
  136.   -----------------------------------------------------------------------------
  137.  
  138.       The registration fee is $35, payable to:
  139.  
  140.         Aquila Data Systems
  141.         304 Bayfield Drive
  142.         Brandon, FL  33511
  143.  
  144.       The payment of this registration fee to the author entitles the user to
  145.     full use of the product for an unlimited period of time in addition to
  146.     product support.  The distribution of diskette copies of PCBSuperScript
  147.     and future upgrades is not included as part of the basic registration
  148.     fee. See the ORDER.SS file for the charges associated with these
  149.     services.
  150.  
  151.       PCBSuperScript is the sole property of Chris Curran.  The program may
  152.     be freely copied and transferred to individual parties for evaluation
  153.     purposes.  It may be posted on Bulletin Board systems (BBS) for
  154.     electronic access as long as NO FEE is charged for its distribution
  155.     except for private BBS operations that charge a regular user subscription
  156.     fee. Computer information services such as Compuserve (CIS), Genie, and
  157.     Byte Information Exchange (BIX) are authorized to post this product for
  158.     subscriber access.  PCBSuperScript may be distributed on diskette only by
  159.     1) disk distributors/vendors who are associate members of the Association
  160.     of Shareware Professionals (ASP) or 2) users groups which do not charge
  161.     more than a nominal fee ($5) to cover the costs of distribution.  Any
  162.     changes to these policies must be made in writing by the author.
  163.  
  164.       PCBSuperScript is a fully functional Shareware product. Shareware is a
  165.     computer program distribution/marketing method that permits potential
  166.     buyers to thoroughly try the program prior to purchase. It is NOT free
  167.     and it is not in the Public Domain.  If, after evaluating the program,
  168.     you find it useful enough to use on a regular basis, you are expected to
  169.     pay for it by registering with the author.
  170.  
  171.       Attractively-priced site licensing is available for commercial users.
  172.     Pricing for "typical" site licensing is given later in this manual.  If
  173.     you have needs which are not met by the standard license terms, please
  174.     call or write for a quote which addresses any unique support or product
  175.     update requirements.  Customization is also available on a contract
  176.     basis.
  177.  
  178.       There has been some confusion in Shareware circles recently about
  179.     upgrade/update policies for certain pieces of software.  Therefore, I'd
  180.     like to take this opportunity to spell out my policies.  First, some
  181.     definitions:  I define upgrade as the RIGHT to use a later revision of a
  182.     piece of software.  I define update as the physical media on which the
  183.     upgrade resides.  I'll further define an update as not including
  184.     hard-copy documentation unless specifically defined.  With that out of
  185.     the way, I'd like to spell out my current upgrade/update policies:
  186.  
  187.       There are no upgrade charges associated with PCBSuperScript and I do
  188.     not have any plans at present to institute such charges with future
  189.     revisions. I do reserve the right to do so, however, if in my sole
  190.     opinion the nature and magnitude of PCBSuperScript changes to such a
  191.     degree as to constitute an essentially new product.  I currently do
  192.     charge for updates and plan to continue to so charge.  The content and
  193.     pricing for specific update packages is contained in the ORDER.SS file.
  194.     Pricing is subject to change without notice however, to accommodate
  195.     postage, printing, and other price increases.
  196.  
  197.  
  198.  
  199.   Distributing PCBSuperScript
  200.   -----------------------------------------------------------------------------
  201.  
  202.       PCBSuperScript may be freely distributed  (subject to the for-charge
  203.     distribution restrictions detailed in the Registration section).
  204.     Therefore, please feel free to distribute copies of this program to
  205.     friends, co-workers, bulletin boards, and users' groups.  I do ask,
  206.     however, that you please distribute all of the original files and not
  207.     modified copies. Thank you in advance for your cooperation.
  208.  
  209.  
  210.   Technical Support
  211.   -----------------------------------------------------------------------------
  212.  
  213.   ┌─  Registered Users: Full technical support is available to registered
  214.   │ users of PCBSuperScript.  I have found that the most effective product
  215.   │ support can be delivered through the electronic services listed below. If
  216.   │ this option is not open to you, however, I also offer full product support
  217.   │ through the mails, or, if the problem absolutely cannot wait, the
  218.   │ telephone (no collect calls please).  I will do my best to resolve any
  219.   │ software bugs in a timely manner and I am always open to incorporating new
  220.   │ features or changes which are appropriate to the nature of the product.
  221.   │
  222.   ├─  Unregistered Users: I will attempt to respond to software trouble
  223.   │ reports made by non-registered users if the problems affect the general
  224.   │ functionality of the program.  Such users should not, however, expect
  225.   │ product support beyond initial aid to determine if the program is suitable
  226.   │ for their needs.
  227.   │
  228.   │   All Users: If you have a problem:  I ask that, before calling or
  229.   │ writing, you take the following steps:
  230.   │
  231.   │    1)  Check the manual. We all sometimes approach a piece of software
  232.   │        with preconceived ideas about how it ought to work which may not
  233.   │        correspond to how it actually does work.  (Of course, I'm
  234.   │        interested in your input if you have this sort of experience.)
  235.   │
  236.   │    2)  Have you loaded any new TSR's? Changed DOS versions? Modified any
  237.   │        system files (CONFIG.SYS or AUTOEXEC.BAT) recently? Check to make
  238.   │        sure these changes were done properly.
  239.   │
  240.   │    3)  Run a CHKDSK on your system. It's a basic thing, but we sometimes
  241.   │        forget about it (at least I do).
  242.   │
  243.   │    4)  If you're still stuck, please aquire the following information
  244.   │        and upload it to QExchange BBS:
  245.   │
  246.   │        a) Your hardware and software environment. PCBSuperScript is a very
  247.   │           versatile program and, unfortunately, one of the downsides of
  248.   │           this versatility is that settings can sometimes interact in
  249.   │           unexpected ways.  I try to test a broad range of environments
  250.   │           and settings, but obviously can't try every one.
  251.   │
  252.   │        b) The sequence of actions which lead to the error.  If I can't
  253.   │           reproduce the error, it will be very difficult to correct it, so
  254.   │           your help is vital in isolating the problem.
  255.   │
  256.   │        c) The PCBSS definition file and ALL associated files for that
  257.   │           definition file (i.e. environment settings, PORT settings,
  258.   │           etc.)
  259.   │
  260.   │           ***************************************************************
  261.   └───────   * If you do not following the above steps for reporting PCBSS *
  262.               * problems, I cannot help you. If you leave a message asking  *
  263.               * for help WITHOUT the above information, it will be IGNORED. *
  264.               *                                                             *
  265.               *   This applies to registered and unregistered users alike.  *
  266.               ***************************************************************
  267.  
  268.  
  269.       If you follow these steps, it will help me to solve your problem in a
  270.     more efficient and timely manner.
  271.  
  272.       Contact via:
  273.  
  274.         QExchange BBS
  275.           Line #1   (813)653-2937   1200-57,600 v.32/42 bis
  276.           Line #2   (813)685-4218   1200-57,600 v.32/42 bis
  277.  
  278.         U.S. Mail
  279.           Aquila Data Systems
  280.           304 Bayfield Drive
  281.           Brandon, FL  33511
  282.  
  283.  
  284.  
  285.   Abstract
  286.   -----------------------------------------------------------------------------
  287.  
  288.       PCBSuperScript is a script processing language specificaly designed to
  289.     meet the needs of PCBoard Sysops. Since PCBSuperScript is a script
  290.     processor, some degree of planning will be necessary. Just like you have
  291.     to plan out (and test) large and advanced BAT files, you'll have to plan
  292.     out the PCBSuperScript files.
  293.  
  294.       PCBSuperScript offers control features that are similar to many
  295.     programming languages. You do not need to use all the features of
  296.     PCBSuperScript, but if you want to use it to it's fullest, some degree of
  297.     programming background will help.
  298.  
  299.       Before you become scared away from PCBSuperScript because you don't
  300.     know programming, keep in mind that only advanced needs will require
  301.     advanced scripts. Start off simple and work up to the advanced level. If
  302.     you find the task impossible, leave me an example on my BBS and I'll try
  303.     to point you in the right direction. I won't write the script for you,
  304.     but I will advise on the method to use.
  305.  
  306.  
  307.       Some of the things you can perform with PCBSuperScript:
  308.  
  309.         o You can create your own doors, without being a programmer.
  310.  
  311.         o You can use a large number of testing methods, and react to caller
  312.           entry in an intelligent manner. You can ask questions based on the
  313.           result of a previous question, execute only certain portions of a
  314.           script, provide default answers to questions, provide field
  315.           formatting instructions, etc...
  316.  
  317.         o PCBSuperScript field entry can require a minimum and maximum number
  318.           of char's to be entered, allow only certain types of data to be
  319.           entered (char or numeric) and automatic formatting of phone number
  320.           type fields.
  321.  
  322.         o YOU have direct control over what, and how data is written to the
  323.           log file.
  324.  
  325.         o A PCBSuperScript script can be limited to callers with a specific
  326.           security level, and also require a password to enter it.
  327.  
  328.         o PCBSuperScript only displays what you tell it to; you don't have to
  329.           have the first six lines of anything displayed.
  330.  
  331.         o You can modify the caller security level.
  332.  
  333.         o You can place entries in the caller log.
  334.  
  335.         o You can send a message to the caller, yourself or anyone else, in
  336.           any conference.
  337.  
  338.         o Shell to any DOS program, or perform any DOS command.
  339.  
  340.  
  341.       Unlike most other data acquisition doors (i.e. registration doors),
  342.     PCBSuperScript does not bind you to one method/format of acquiring user
  343.     input, or the purpose for which it's used.
  344.  
  345.       PCBSuperScript can be used for almost anything, but I use it for the
  346.     following purposes on my BBS:
  347.  
  348.           o   New caller registration, with immediate security update's (and
  349.               a COMMENT sent to SYSOP).
  350.           o   General Q&A of the caller.
  351.           o   Accepting software bug reports.
  352.           o   Processing on-line orders.
  353.           o   Specialized file transfers.
  354.  
  355.  
  356.   Requirements
  357.   ───────────────────────────────────────────────────────────────────────────
  358.  
  359.       PCBSuperScript requires:
  360.  
  361.         o PCBoard version 14.5 or higher.
  362.         o 90-256k free memory (128k typical), depending on size the of script
  363.           loaded.
  364.  
  365.  
  366.         NOTE: If you are *not* using version 14.5a of PCBoard (the current
  367.               release), you will need to SET a few environment variables in
  368.               your BOARD.BAT file. They are:
  369.  
  370.                 PCBDRIVE   PCBoard's home drive letter
  371.                 PCBDIR     PCBoard's home directory
  372.                 PCBDAT     name/location of PCBOARD.DAT
  373.  
  374.             Example:
  375.  
  376.                 SET PCBDRIVE = J:
  377.                 SET PCBDIR   = \PCB
  378.                 SET PCBDAT   = J:\PCB\PCBOARD.DAT
  379.  
  380.  
  381.   Installing PCBSuperScript
  382.   ───────────────────────────────────────────────────────────────────────────
  383.  
  384.       Installing PCBSuperScript is as easy as copying the file SS.EXE to your
  385.     PCBoard door directory. Then for each door that you wish to create, you'll
  386.     need to create the door driver and definition files.
  387.  
  388.       The door driver file is the file that PCBoard uses to execute the door.
  389.     For example, if you wanted to setup a door named "INFO", you would create
  390.     a file named "INFO" (no extension) in your PCBoard directory. The contents
  391.     of this file would look something like the following:
  392.  
  393.           @echo off
  394.           ss j:\pcb\ss\info.def
  395.           exit
  396.  
  397.       This example would load PCBSuperScript with the definition file
  398.     "J:\PCB\SS\INFO.DEF". PCBSuperScript does not require that you supply the
  399.     drive and path to the definition file - I just always include such
  400.     information to keep confusion down to a minimum (my own).
  401.  
  402.       You will then need to use PCBSETUP to add the door to DOOR.LST
  403.     as follows:
  404.  
  405.     ┌───────────────────────────────────────────────────────────────────────┐
  406.     │                                    USER DOOR                          │
  407.     │   Filename    Password   Sec Login SYS  SYS  Shell Path to DOOR Files │
  408.     │  ══════════ ════════════ ═══ ═════ ════ ════ ═════ ═══════════════════╡
  409.     │ 1) INFO                    9   Y    Y    N     N   J:\PCB\SS          │
  410.     └───────────────────────────────────────────────────────────────────────┘
  411.                                                          |
  412.                                                          +-edit accordingly
  413.         Filename    The name of the door.
  414.         Password    Optional password for this door.
  415.         Sec         Security level needed to open this door.
  416.         Login       'Y' if this is a login door, 'N' otherwise.
  417.         USER SYS    ALWAYS set to 'Y' for PCBSuperScript doors.
  418.         DOOR SYS    ALWAYS set to 'N' for PCBSuperScript doors.
  419.         Shell       Determines how PCBoard will shell to the door. NOTE: If
  420.                     you set this field to 'N', you *must* replace the "exit"
  421.                     verb in the door driver file with "board".
  422.         Path        Optional path to door files.
  423.  
  424.  
  425.  
  426.   General Description of Scripts
  427.   ───────────────────────────────────────────────────────────────────────────
  428.  
  429.  
  430.     Script Definition
  431.     ─────────────────
  432.  
  433.       A script file is a standard DOS ASCII file that contains a list of
  434.     commands to perform. All PCBSuperScript script files are standard ASCII
  435.     text files. These files are created and maintained in much the same manner
  436.     as your AUTOEXEC.BAT and CONFIG.SYS files are. Do NOT use MS Word,
  437.     WordPerfect or other similar word processors to create/maintain script
  438.     files. A text editor will be needed for this purpose (QEdit being my
  439.     personal choice).
  440.  
  441.     A script file cannot be larger than 62k.
  442.  
  443.  
  444.     Script Labels
  445.     ─────────────
  446.  
  447.       Labels are "place markers" used by your script. Your script will refer
  448.     to labels for various reasons, but most of the time they are used in
  449.     combonation with a GOTO or GOSUB command. Labels are alpha-numeric and
  450.     begin or end with a colon (":").
  451.  
  452.  
  453.     Script Comments
  454.     ───────────────
  455.  
  456.       The ';' character is used as a comment character in script files.
  457.     The comment character may begin at any position on the line. Script
  458.     lines that are entirely comment lines are not loaded into memory. There
  459.     are no memory or performance penalties for using comments in your
  460.     scripts.
  461.  
  462.         NOTE:   If the comment character needs to be used in a string, it
  463.                 should be enclosed between matching quotes.
  464.  
  465.  
  466.  
  467.     Script Parsing
  468.     ──────────────
  469.  
  470.       The command parsing of PCBSuperScript is different than what most users
  471.     are probably familiar with, but you'll soon discover that it is very easy
  472.     and powerful at the same time.
  473.  
  474.       PCBSuperScript parses the script files one word at a time. A "word" to
  475.     PCBSuperScript is any text separated by a space(s), tab character(s) or
  476.     any text enclosed by matching quotes. All spaces and tabs are removed from
  477.     between words while processing. Therefore, if you are using a parameter
  478.     that contains one or more spaces, you must enclose it in matching quotes
  479.     so that the spaces are not removed.
  480.  
  481.       It is important to understand the usage of quotes in PCBSuperScript.
  482.     Since PCBSuperScript allows "stacking" of text and variables in a script
  483.     line, there must be some way for it to discern variables from literal text.
  484.     Whenever PCBSuperScript encounters a quote (single or double), it will
  485.     search for the next matching quote. The data between the matching quotes
  486.     is then treated as one "word".
  487.  
  488.       While PCBSuperScript is processing a script line, each word is checked
  489.     against the variable table first; if a match is found, the value of the
  490.     variable is accumulated internally. If a match is not found, the word
  491.     itself is accumulated. Remember, text enclosed by matching quotes is
  492.     treated as one word; regardless of the number of spaces it contains. The
  493.     final result is a combination of all variables and literal text in the
  494.     script line.
  495.  
  496.       For example, the following commands will display different results to
  497.     the screen due to the different usage of quotes:
  498.  
  499.         COMMAND:    TEXT "Display this data to the screen"
  500.          RESULT:    Display this data to the screen
  501.  
  502.         COMMAND:    TEXT Display this data to the screen
  503.          RESULT:    Displaythisdatatothescreen
  504.  
  505.       As was noted earlier, PCBSuperScript allows "stacking" of text and
  506.     variables in a script line. The following example demonstrates this:
  507.  
  508.         COMMAND:    TEXT "Date: " @sysdate@ "   Time: " @systime@
  509.          RESULT:    Date: 06-17-91   Time: 04:28
  510.  
  511.         COMMAND:    TEXT  Date: @sysdate@    Time: @systime@
  512.          RESULT:    Date:06-17-91Time:04:28
  513.  
  514.       Again, note the usage of quotes, and the results.
  515.  
  516.  
  517.  
  518.   Tutorial
  519.   ───────────────────────────────────────────────────────────────────────────
  520.  
  521.       This section is a tutorial on the basic use of PCBSuperScript. It is
  522.     recommended that all users complete this section, regardless of previous
  523.     experience.
  524.  
  525.       The following sections instruct you to create, and add text to three
  526.     files: NEWCALL, NEWCALL.MSG and NEWCALL.DEF. These files are also included
  527.     with this ZIP file (in case you do not wish create and enter these files).
  528.     However, you should check these files for directory specific items, and
  529.     change accordingly.
  530.  
  531.       Also note that there are a number of sample scripts for PCBSuperScript
  532.     included ("*.DEF"). They should be printed out and studied at your
  533.     leisure.
  534.  
  535.  
  536.   PCBoard Macros and Environment Variables
  537.   ───────────────────────────────────────────────────────────────────────────
  538.  
  539.     The following PCBoard Macros are available:
  540.  
  541.       Caller Information
  542.       ──────────────────
  543.         @bps@             Connect Speed
  544.         @city@            City
  545.         @comment1@        Comment line 1
  546.         @comment2@        Comment line 2
  547.         @confnum@         Current Conference Number
  548.         @dataphone@       Business/Data Phone
  549.         @daybytes@        Daily D/L Bytes
  550.         @dlbytes@         Total D/L Bytes
  551.         @dlfiles@         Total D/L Files
  552.         @expertmode@      Expert mode
  553.         @expdate@         Expiration Date
  554.         @file_stat@       Status of last PCBSuperScript file command
  555.         @first@           First Name (first letter capitalized)
  556.         @firstu@          First Name (all caps)
  557.         @graphics@        0 = not in graphics mode, 1 = in graphics mode
  558.         @homephone@       Home/Voice Phone
  559.         @lastdateon@      Last Date On
  560.         @lasttimeon@      Last Time On
  561.         @minleft@         Minutes Left
  562.         @msgleft@         Number of Messages Written
  563.         @msgread@         Number of Messages Read
  564.         @numtimeson@      Number of Times On
  565.         @pagelen@         Page length setting
  566.         @password@        User password
  567.         @port@            Port id
  568.         @proltr@          Default Protocol Letter
  569.         @security@        Security Level
  570.         @shell_stat@      Status of last PCBSuperScript shell command
  571.         @timelimit@       Time Limit
  572.         @timeused@        Time Used
  573.         @totaltime@       Total Time Used so far Today
  574.         @upbytes@         Total U/L Bytes
  575.         @upfiles@         Total U/L Files
  576.         @user@            Full Name (all caps)
  577.  
  578.       System Information
  579.       ------------------
  580.         @boardname@       Name of the BBS you are on
  581.         @event@           Event Time
  582.         @node@            Node Number
  583.         @sysdate@         Current Date
  584.         @systime@         Current Time
  585.         @ss_version@      PCBSuperScript version number
  586.  
  587.  
  588.       Display Controls
  589.       ----------------
  590.         @automore@        treats "more?" prompts in a file like @pause@
  591.  
  592.         @beep@            sends a CTRL-G (ascii BELL character) to the
  593.                           caller but is not heard on the local machine
  594.                           unless the Caller Alarm is turned on
  595.  
  596.         @cls@             clear the entire screen
  597.  
  598.         @clreol@          clear from the cursor to the end of the line
  599.  
  600.         @more@            cause a "more?" prompt to be displayed
  601.  
  602.         @pause@           displays a "more?" prompt with a 10 second auto
  603.                           return if the caller doesn't answer it first
  604.  
  605.         @poff@            Turns Prompts OFF (disables "more?" prompt)
  606.  
  607.         @pon@             Turns Prompts ON  (enables  "more?" prompt)
  608.  
  609.         @qoff@            disables CTRL-X/CTRL-K checking (display abort)
  610.  
  611.         @qon@             enables CTRL-X/CTRL-K checking  (display abort)
  612.  
  613.         @wait@            display a "press enter to continue" prompt
  614.  
  615.  
  616.  
  617.       Environment variables are variables that are currently defined in your
  618.     DOS environment. Environment variables are accessed in the following
  619.     manner:
  620.  
  621.         @%name      Access environment variable "name".
  622.  
  623.  
  624.       Whenever a PCBoard Macro or Environment variable is referenced in a
  625.     script, the current value of the variable is substituted for the variable
  626.     name.
  627.  
  628.  
  629.  
  630.   Script Variables
  631.   ───────────────────────────────────────────────────────────────────────────
  632.  
  633.       Variables must be declared in the script file prior to usage, and are
  634.     defined in the following manner:
  635.  
  636.           FIELDS
  637.             <name>  <type> <len> <prec> <min> <mask> <default>
  638.             .......
  639.             .......
  640.             <name>  <type> <len> <prec> <min> <mask> <default>
  641.           FIELDS
  642.  
  643.       The command "FIELDS" is used to mark the beginning and end of a list of
  644.     script variables. Lines between matching "FIELDS" keywords, are
  645.     considered field descriptor lines. The format of a descriptor line is:
  646.  
  647.           name      The name of the variable. 1 to 32 char's. Case *is*
  648.                     significant. If the variable name is already defined,
  649.                     this definition will be ignored.
  650.  
  651.           type      The type of the field. 1 char.
  652.                     'C'   Character field.
  653.                     'N'   Numeric field.
  654.  
  655.           len       The length of this variable. For 'C' type fields, this
  656.                     should be the TOTAL length of the field, including any
  657.                     mask characters, etc. If the field is type 'N', this
  658.                     represents the number of digits to the left of the
  659.                     decimal point.
  660.  
  661.           prec      The precision of this variable. If the field type is 'C',
  662.                     the precision is forced to 0. For 'N' type fields, this
  663.                     represents the number of digits to the right of the
  664.                     decimal point.
  665.  
  666.           min       The minimum entry length of this variable (in an ACCEPT
  667.                     or PROMPT command).
  668.  
  669.           mask      The entry mask. The "mask" field provides PCBSuperScript
  670.                     with information on how it should handle user entry for
  671.                     this variable.
  672.  
  673.                     The mask is a combination of special formatting characters
  674.                     and literal text that describes how each character of the
  675.                     field should be handled. A mask may consist of literal
  676.                     characters or any of the following special characters:
  677.  
  678.                       %   digits, space, minus, dot
  679.                       9   digits ONLY
  680.                       *   any char
  681.                       !   printable only
  682.                       a   space,alpha,num char's only (tolower)
  683.                       A   space,alpha,num char's only (toupper)
  684.                       h   hex char's only (tolower)
  685.                       H   hex char's only (toupper)
  686.                       Y   Yes or No
  687.                       P   Protected. A dot ('.') is eched back to the
  688.                           caller.
  689.                      <>   Inclusion set. Char's between matching <> are
  690.                           considered the only allowable char's for the
  691.                           position marked by '<'. See 'Option' field below.
  692.  
  693.                     If the length of the mask is less than the defined length
  694.                     of the variable, the mask is expanded to the defined
  695.                     length. The last character in the mask is used for the
  696.                     expansion. See 'Name' field below.
  697.  
  698.           default   The default value of the field (optional). This can be
  699.                     any text enclosed by matching quotes, system variables or
  700.                     environment variables (see System Variables).
  701.  
  702.  
  703.       The following FIELDS block defines a commonly required group of
  704.     variables:
  705.  
  706.           FIELDS
  707.             Option    C    1   0    1  <ALEale>
  708.             Name      C   25   0    0  *!               @user@
  709.             Company   C   25   0    3  !
  710.             Addr      C   25   0    5  !
  711.             CitySt    C   25   0    5  !                @city@
  712.             Zip       C    5   0    5  99999
  713.             Country   C   15   0    3  !                USA
  714.             Phone     C   13   0   13  (999)999-9999
  715.             Fax       C   13   0    0  (999)999-9999
  716.             Num2Call  C   45   0    0  *
  717.             Age       C    2   0    2  99
  718.             How       C   25   0    0  !
  719.             Occup     C   25   0    0  !
  720.             PCType    C   25   0    0  !
  721.             NetWork   C   25   0    0  !
  722.           FIELDS
  723.  
  724.       Note the usage of "@user@" and "@city@". These are two of the available
  725.     system variables (or macros), and are used here to provide a default
  726.     answer for the appropriate fields. The "Country" field uses a literal
  727.     text default value of "USA".
  728.  
  729.       Any number of FIELDS blocks may be defined, provided not more that 500
  730.     variables are defined at any one time (see RELEASE below). When a
  731.     variable is defined, it will continue to "exist" until PCBSuperScript is
  732.     exited, or it is released with the RELEASE command. This allows you to
  733.     easily share data between different scripts (using the CALL or RUN
  734.     command).
  735.  
  736.  
  737.   Displaying information to the caller
  738.   ───────────────────────────────────────────────────────────────────────────
  739.  
  740.       The TEXT command is one of the commands that can be used to display
  741.     data to the caller. The data displayed may contain a combination of
  742.     literal data, field names, system variables and environment variables.
  743.     The combination of all data (the final result) may not exceed 512
  744.     char's PER LINE. PCBoard @X color codes are recognized.
  745.  
  746.       The NEWLINE command is used to display one or more blank lines to the
  747.     screen. The maximum number of blank lines that may be displayed is
  748.     "limited" to 65,535. Issueing a "NEWLINE 25" will fake a clear screen on
  749.     the caller's screen; in either graphics mode.
  750.  
  751.       The INDENT command is used to position the displayed text to a specific
  752.     column.
  753.  
  754.     Add the following lines to "NEWCALL.DEF":
  755.  
  756.       NEWLINE 24
  757.       INDENT  5
  758.       TEXT  "---------------------------------------------------------------"
  759.       TEXT  "               **** A Great Bulletin Board ****"
  760.       TEXT  "---------------------------------------------------------------"
  761.       NEWLINE 2
  762.       TEXT  "You are in the new caller login section. After completing"
  763.       TEXT  "the questions below, you will be returned to the main bulletin"
  764.       TEXT  "board."
  765.       TEXT  ""
  766.       TEXT  "This is a one-time procedure. Estimated time to complete this"
  767.       TEXT  "questionnaire is 2 to 4 minutes."
  768.       TEXT  ""
  769.       TEXT  "                  Date: " @sysdate@
  770.       TEXT  "                  Time: " @systime@
  771.       TEXT  "           Caller Name: " @user@
  772.       TEXT  "           City, State: " @city@
  773.       TEXT  "        Security Level: " @security@
  774.       TEXT  "             Baud Rate: " @bps@
  775.       TEXT  "                  Node: " @node@
  776.       TEXT  ""
  777.       TEXT  "---------------------------------------------------------------"
  778.       TEXT  ""
  779.       INDENT  0
  780.  
  781.  
  782.       Another command that is used to display data to the caller is
  783.     "DISPLAY_FILE". This command will display the contents of a file to the
  784.     screen.
  785.  
  786.     Add the following line to "NEWCALL.DEF":
  787.  
  788.       DISPLAY_FILE J:\PCB\SS\NEWCALL.MSG
  789.                    |
  790.                    +-edit accordingly
  791.  
  792.  
  793.   Data Entry
  794.   ───────────────────────────────────────────────────────────────────────────
  795.  
  796.       Before discussing data entry commands, field masks need to be
  797.     explained. A field mask could be thought of as a 'template' for how each
  798.     character in the field should be entered. Field masks are defined with
  799.     the variable in a FIELDS block, or inline with the SETMASK command.
  800.  
  801.       A field mask is comprised of mask characters, literal characters and
  802.     inclusion sets (each is defined below). For each position in the field
  803.     that a character will be entered, a mask characacter must be used as a
  804.     'place holder'.
  805.  
  806.         mask char   Characters entered in this position are checked for
  807.                     validity based on the mask character used:
  808.  
  809.                     Char    Characters allowed at position
  810.                     ----------------------------------------------------
  811.                       %     Digits, space, minus, dot
  812.                       9     Digits ONLY
  813.                       *     Any char
  814.                       !     Printable only
  815.                       a     Space,alpha,num char's only (conv to lower)
  816.                       A     Space,alpha,num char's only (conv to upper)
  817.                       h     Hex char's only (conv to lower)
  818.                       H     Hex char's only (conv to upper)
  819.                       Y     Yes or No
  820.                       P     Protected. A dot ('.') is eched back to the
  821.                             caller.
  822.  
  823.         literal     Any character not in the above set (including spaces). If
  824.                     one of the above characters is needed as a literal
  825.                     character, preceed it with a backslash ('\'). Literal
  826.                     characters are copied to the input field. The cursor will
  827.                     not 'sit' on a literal character.
  828.  
  829.         inclusion   Characters entered in this position are checked against a
  830.                     provided list of 'valid' characters. The valid characters
  831.                     are enclosed by "<>".
  832.  
  833.  
  834.       Examples:
  835.  
  836.         Name      C   25   0    0  *!               @user@
  837.  
  838.             This field mask will allow any character to be entered in the
  839.             first position of the field, and any printable chacater in the
  840.             remaining 24 positions.
  841.  
  842.             NOTE:   Since the mask was defined with length of 2 ("*!"),
  843.                     PCBSuperScript will expand this at the time of
  844.                     definition to "*!!!!!!!!!!!!!!!!!!!!!!!!".
  845.  
  846.         Phone     C   13   0   13  (999)999-9999
  847.  
  848.             This field mask will allow digits at positions 2-4, 6-8 and
  849.             10-13. The cursor will not be allowed to rest on positions 1, 5
  850.             and 9. The characters '(', ')' and '-' will autofill at entry
  851.             time, and will be copied to the field variable upon entry.
  852.  
  853.         Option    C    1   0    1  <ALEale>
  854.  
  855.             This field mask uses an inclusion set to allow entry of the
  856.             letters 'A', 'L', 'E', 'a', 'l' and 'e'. Any other character
  857.             will be ignored for this position.
  858.  
  859.  
  860.       There are two commands that are used to perform data entry in
  861.     PCBSuperScript. The first command, 'PROMPT', does not require an ANSI
  862.     driver. The PROMPT command will work regardless of the graphics mode of
  863.     the caller. The second command, 'ACCEPT' requires that an ANSI driver be
  864.     present (i.e. caller in graphics mode). This command allows you to
  865.     directly address row/col coordinates on the screen (i.e full screen
  866.     operations).
  867.  
  868.       When the caller is in non-graphics mode and the script uses an ACCEPT
  869.     command, it will be internally converted to a PROMPT command. Any
  870.     row/col information is ignored and the resulting display may not be what
  871.     you expect. You should experiment with this feature in both graphics
  872.     modes to verify that your scripts operate as expected.
  873.  
  874.       NOTE: Both commands utilize the field mask in the same manner.
  875.  
  876.  
  877.     The PROMPT command has the following format:
  878.  
  879.           PROMPT  prompt_msg  variable
  880.  
  881.           where:
  882.               prompt_msg      the prompt displayed to the caller
  883.               variable        the variable name used to store the caller's
  884.                               entry.
  885.  
  886.       Example:
  887.           ;
  888.           ; Field definitions
  889.           ;
  890.           FIELDS
  891.             Option    C    1   0    1  <ALEale>
  892.             Name      C   25   0    0  *!               @user@
  893.             Company   C   25   0    3  !
  894.             Addr      C   25   0    5  !
  895.             CitySt    C   25   0    5  !                @city@
  896.             Zip       C    5   0    5  99999
  897.             Country   C   15   0    3  !                USA
  898.             Phone     C   13   0   13  (999)999-9999
  899.             Fax       C   13   0    0  (999)999-9999
  900.             Num2Call  C   45   0    0  *
  901.             Age       C    2   0    2  99
  902.             How       C   25   0    0  !
  903.             Occup     C   25   0    0  !
  904.             PCType    C   25   0    0  !
  905.             NetWork   C   25   0    0  !
  906.           FIELDS
  907.           ;
  908.           ; Field entry
  909.           ;
  910.           PROMPT "         Company: " Company
  911.           PROMPT "         Address: " Addr
  912.           PROMPT "     City, State: " CitySt
  913.           PROMPT "             Zip: " Zip
  914.           PROMPT "         Country: " Country
  915.           PROMPT "    Phone Number: " Phone
  916.           PROMPT " Fax/Data Number: " Fax
  917.           PROMPT "        Your Age: " Age
  918.           NEWLINE
  919.           PROMPT "                Your occupation: " Occup
  920.           PROMPT " How did you hear of QExchange?: " How
  921.           PROMPT "    What type of PC do you use?: " PCType
  922.           PROMPT "    PC NetWork (if you use one): " NetWork
  923.           ;
  924.           ; all done...
  925.           ;
  926.           EXIT
  927.  
  928.  
  929.     Changing the field mask
  930.     -----------------------
  931.  
  932.       Most of the time the entry mask that's defined with a field is
  933.     sufficient for the entire run of the script. There are times however,
  934.     that changing the entry mask at run time is desirable. An example is a
  935.     field that's used to store the result of an "option" type of prompt. For
  936.     example:
  937.  
  938.         setmask Option "<123>"            ;set new entry mask Option
  939.         prompt  "Select option 1, 2 or 3" Option
  940.         ...
  941.         ...
  942.         setmask Option "<ABCabc>"         ;set new entry mask Option
  943.         prompt  "Select option A, B or C" Option
  944.  
  945.  
  946.  
  947.     Escape Checking during data entry
  948.     ---------------------------------
  949.  
  950.       If you want to allow the caller to press ESC to abort entry of the
  951.     current field, use the ESC_CHK command ("ESC_CHK ON"). If the caller
  952.     presses ESC, the contents of the field is restored and the system
  953.     variable '@esc_pressed@' is set to '1'. You can test for this with the
  954.     following code:
  955.  
  956.         ESC_CHK   ON                        ;turn escape checking on
  957.         PROMPT "            Name: " Name    ;get name from caller
  958.         IF @esc_pressed@ == 1               ;chk for esc press
  959.           GOTO AbortJob                     ; abort script if pressed
  960.         ENDIF                               ;
  961.  
  962.       This method works fine if you're only inputing one field, but if the
  963.     script is accepting input of multiple fields, you may wish to use the
  964.     'ESC_TO' command. This command is used to set a label that the script
  965.     will jump to if esc is pressed in a PROMPT or ACCEPT command.
  966.  
  967.       :AddRec
  968.         ESC_CHK   ON                        ;turn escape checking on
  969.         ESC_TO    AddRec99                  ;set ESC_TO label
  970.         PROMPT    "            Name: " Name ;get name from caller
  971.         .....
  972.         .....
  973.  
  974.       :AddRec99                             ;exit label
  975.         ESC_TO                              ;reset ESC_TO label
  976.         ESC_CHK   OFF                       ;turn escape checking on
  977.         RETURN                              ;return to caller
  978.  
  979.  
  980.     Automatic Enter
  981.     ---------------
  982.  
  983.       The command AUTOENTER ON/OFF can cause PCBSuperScript to simulate a
  984.     press of the <ENTER> key when the caller reaches the end of the current
  985.     entry field. This command can be used with a 1 character field to
  986.     provide "hot-key" fields. See NEWCALL.DEF for an example.
  987.  
  988.  
  989.     Forcing the caller to press ENTER
  990.     ---------------------------------
  991.  
  992.       Displays a "Press Enter to continue..." prompt, and waits for
  993.     the caller to press ENTER.
  994.  
  995.  
  996.     Clearing the keyboard
  997.     ---------------------
  998.  
  999.       The FLUSH_KB command will clear the keyboard buffer. This is usefull
  1000.     when you want to defeat the type-ahead allowed by PCBoard. For example:
  1001.  
  1002.       flush_kb            ;clear kb in case they've already pressed ENTER
  1003.       force_enter         ;make caller press enter
  1004.  
  1005.  
  1006.     Barking at the caller
  1007.     ---------------------
  1008.  
  1009.       The BEEPS ON/OFF command sets the beep mode of the PCBSS PROMPT and
  1010.     ACCEPT commands. If BEEPS ON is in effect, PCBSS will beep the caller
  1011.     when they've reached the end of an input area. If BEEPS OFF is in
  1012.     effect, PCBSS will simply stop at the end of the input area. Example:
  1013.  
  1014.       beeps off                                 ;don't bark at caller
  1015.       setmask Option "<ABCabc>"                 ;set new entry mask Option
  1016.       prompt  "Select option A, B or C" Option  ;get caller input
  1017.  
  1018.  
  1019.     Free form data entry
  1020.     --------------------
  1021.  
  1022.       The GETMSG command is used to accept input of free form blocks of text
  1023.     from the caller. The GETMSG has the same commands, and acts in the same
  1024.     manner as PCBoard full screen message entry. This command is most often
  1025.     used to get caller comments, special instructions, etc... Note that the
  1026.     caller must be in graphics mode for this command to function correctly.
  1027.  
  1028.       GETMSG <format> <srow> <scol> <rows> <cols>
  1029.  
  1030.               format    The name of the FORMAT for this message.
  1031.               srow      The starting row of the message entry area.
  1032.               scol      The starting col of the message entry area.
  1033.               rows      The number of DISPLAY rows of the msg. The number of
  1034.                         message rows are deduced from the the number of
  1035.                         fields defined in the format used with this msg
  1036.                         command.
  1037.               cols      The number of display columns for this message entry
  1038.                         area.
  1039.  
  1040.     Example:
  1041.  
  1042.       FIELDS
  1043.         shpins1   C   30   0    0  "*" ""
  1044.         shpins2   C   30   0    0  "*" ""
  1045.         shpins3   C   30   0    0  "*" ""
  1046.         shpins4   C   30   0    0  "*" ""
  1047.         shpins5   C   30   0    0  "*" ""
  1048.         shpins6   C   30   0    0  "*" ""
  1049.         shpins7   C   30   0    0  "*" ""
  1050.         shpins8   C   30   0    0  "*" ""
  1051.         shpins9   C   30   0    0  "*" ""
  1052.         shpins10  C   30   0    0  "*" ""
  1053.       FIELDS
  1054.       ...
  1055.       ...
  1056.       FORMAT MsgFmt
  1057.         shpins1
  1058.         shpins2
  1059.         shpins3
  1060.         shpins4
  1061.         shpins5
  1062.         shpins6
  1063.         shpins7
  1064.         shpins8
  1065.         shpins9
  1066.         shpins10
  1067.       FORMAT
  1068.       ...
  1069.       ...
  1070.       setmask Option "Y"        ;set new entry mask Option
  1071.       prompt "Any special shipping instructions?" Option
  1072.       if Option == 'Y'
  1073.         getmsg MsgFmt 8 9 5 30    ;enter a msg at row 8, col 9. There
  1074.                                   ;will be 5 displayed rows and 30
  1075.                                   ;display columns, but the caller can
  1076.                                   ;enter upto 10 message lines (rows).
  1077.                                   ;The message data will scroll as
  1078.                                   ;needed during entry.
  1079.       endif
  1080.       ...
  1081.       ...
  1082.  
  1083.  
  1084.  
  1085.   Saving Data
  1086.   ───────────────────────────────────────────────────────────────────────────
  1087.  
  1088.       Data from scripts may be written to text files, dBase III files or
  1089.     both. Commands used with dBase files are discussed in the next section.
  1090.  
  1091.       The command "LOG_DATA" is used to write data to DOS text files. If the
  1092.     specified file currently exists, it will be appended to, otherwise, it
  1093.     will be created.
  1094.  
  1095.       Lines between matching "LOG_DATA" keywords, are considered log file
  1096.     descriptor lines. The format for a log file descriptor line is a variable
  1097.     combination of literal data, field names, system variables and environment
  1098.     variables. The combined total length of a log file descriptor line (after
  1099.     macro and variable expansion) may not exceed a length of 512.
  1100.  
  1101.     Add the following lines to "NEWCALL.DEF":
  1102.  
  1103.           ;
  1104.           ; Field definitions
  1105.           ;
  1106.           FIELDS
  1107.             Option    C    1   0    1  <ALEale>
  1108.             Name      C   25   0    0  *!               @user@
  1109.             Company   C   25   0    3  !
  1110.             Addr      C   25   0    5  !
  1111.             CitySt    C   25   0    5  !                @city@
  1112.             Zip       C    5   0    5  99999
  1113.             Country   C   15   0    3  !                USA
  1114.             Phone     C   13   0   13  (999)999-9999
  1115.             Fax       C   13   0    0  (999)999-9999
  1116.             Num2Call  C   45   0    0  *
  1117.             Age       C    2   0    2  99
  1118.             How       C   25   0    0  !
  1119.             Occup     C   25   0    0  !
  1120.             PCType    C   25   0    0  !
  1121.             NetWork   C   25   0    0  !
  1122.           FIELDS
  1123.           ;
  1124.           ; Field entry
  1125.           ;
  1126.           PROMPT "         Company: " Company
  1127.           PROMPT "         Address: " Addr
  1128.           PROMPT "     City, State: " CitySt
  1129.           PROMPT "             Zip: " Zip
  1130.           PROMPT "         Country: " Country
  1131.           PROMPT "    Phone Number: " Phone
  1132.           PROMPT " Fax/Data Number: " Fax
  1133.           PROMPT "        Your Age: " Age
  1134.           NEWLINE
  1135.           PROMPT "                Your occupation: " Occup
  1136.           PROMPT " How did you hear of QExchange?: " How
  1137.           PROMPT "    What type of PC do you use?: " PCType
  1138.           PROMPT "    PC NetWork (if you use one): " NetWork
  1139.           ;
  1140.           ; append data to log file
  1141.           ;
  1142.           TEXT   "Logging data. Please wait..."
  1143.           LOG_DATA J:\PCB\SS\NEWCALL.LOG        ;<── edit accordingly
  1144.             "-----------------------------------------------"
  1145.             "           Name: " Name ", " Age
  1146.             "        Company: " Company
  1147.             "        Address: " Addr
  1148.             "    City, State: " CitySt
  1149.             "            Zip: " Zip
  1150.             "        Country: " Country
  1151.             "   Phone Number: " Phone
  1152.             "     Fax Number: " Fax
  1153.             "      Date/Time: " @sysdate@  @systime@
  1154.             " Node/Port/Baud: " @node@  @port@  @bps@
  1155.             "-----------------------------------------------"
  1156.           LOG_DATA
  1157.           ;
  1158.           ; all done...
  1159.           ;
  1160.           EXIT
  1161.  
  1162.  
  1163.       The log file result of this example might look something like the
  1164.     following:
  1165.  
  1166.               -----------------------------------------------
  1167.                          Name: Joe Smith, 32
  1168.                       Company: Acme Steel
  1169.                       Address: 123 Metal Lane
  1170.                   City, State: Iron Ore, PA
  1171.                           Zip: 12345
  1172.                       Country: USA
  1173.                  Phone Number: (123)456-7890
  1174.                    Fax Number: (000)000-0000
  1175.                     Date/Time: 12/27/90    09:46:19
  1176.                Node/Port/Baud: 2  1  19200
  1177.               -----------------------------------------------
  1178.  
  1179.  
  1180.   dBase Files
  1181.   ───────────────────────────────────────────────────────────────────────────
  1182.  
  1183.       dBase file records are accessed using a "FORMAT" block. A format block
  1184.     is a list of (previously defined) fields that will be used to transfer
  1185.     data between the file and your script. A FORMAT block is defined as
  1186.     follows:
  1187.  
  1188.         FORMAT <fname> <key flds...>
  1189.             <fld>
  1190.             ...
  1191.         FORMAT
  1192.  
  1193.       The keyword "FORMAT" is used to mark the beginning and end of a list of
  1194.     variables.
  1195.  
  1196.         fname     The name of the format. 1 to 32 char's. Case *is*
  1197.                   significant.
  1198.  
  1199.         key flds  The name(s) of the fields in this format that comprise the
  1200.                   key to a record (multiple key segments are supported).
  1201.  
  1202.         fld       The name of a previously defined field.
  1203.  
  1204.  
  1205.     Example:  FIELDS
  1206.                 Name      C   25   0    0  *!                 @user@
  1207.                 Company   C   25   0    3  !
  1208.                 Addr      C   25   0    5  !
  1209.                 CitySt    C   25   0    5  !                  @city@
  1210.                 Zip       C    5   0    5  99999
  1211.                 Country   C   10   0    3  !                  USA
  1212.                 Phone     C   13   0   13  (999)999-9999
  1213.                 Fax       C   13   0    0  (999)999-9999
  1214.                 Age       C    2   0    2  99
  1215.                 How       C   25   0    0  !
  1216.                 Occup     C   25   0    0  !
  1217.                 PCType    C   25   0    0  !
  1218.                 NetWork   C   25   0    0  !
  1219.                 NetWork   C   25   0    0  !
  1220.                 BankTime  N    3   0    0  999    0
  1221.                 Num2Call  C   45   0    0  *
  1222.               FIELDS
  1223.  
  1224.               FORMAT HistFmt Name
  1225.                 Name
  1226.                 Company
  1227.                 Addr
  1228.                 CitySt
  1229.                 Zip
  1230.                 Country
  1231.                 Phone
  1232.                 Fax
  1233.                 Age
  1234.                 How
  1235.                 Occup
  1236.                 PCType
  1237.                 NetWork
  1238.                 BankTime
  1239.                 Num2Call
  1240.               FORMAT
  1241.  
  1242.       NOTE:   Since you might need to access a dBase file from multiple
  1243.               scripts, it would be a good idea to store file specific FIELDS
  1244.               and FORMAT blocks into a seperate file that is "INCLUDED" into
  1245.               your script at runtime (see the INCLUDE command).
  1246.  
  1247.               This will also aid you in the future if/when you add/change or
  1248.               modify the variables used in a FORMAT block. If you put the
  1249.               FIELDS and FORMAT block directly in your scripts (rather than
  1250.               an INCLUDE file), you will have to hand modify EACH script that
  1251.               will access the file FORMAT you just changed.
  1252.  
  1253.  
  1254.       After the format(s) have been defined, you can open a dBase file and
  1255.     perform normal operations on that file (read, write, etc). You may have
  1256.     up to 10 files open at once. Each file that is used by the script is
  1257.     referenced by a 'handle'. Valid handle values are 0 through 9.
  1258.  
  1259.       The macro "@file_stat@" contains the result of the last dBase file
  1260.     operation performed by PCBSuperScript. All dBase file commands load this
  1261.     macro with "*OK*" if no error occurred. This macro should be checked
  1262.     after a dBase file function to insure proper script operation.
  1263.  
  1264.       If an error does occur during a dBase file command, the variables
  1265.     specified in the format are *not* modified.
  1266.  
  1267.       The following commands are used to perform dBase file operations:
  1268.  
  1269.         Command Parameters                  Description
  1270.       ───────────────────────────────────────────────────────────────────
  1271.         CREATE  <hdl> <format> <file>       Create a dBase file
  1272.         OPEN    <hdl> <file>                Open an existing dBase file
  1273.         CLOSE   <hdl>                       Close an open dBase file
  1274.         READ    <hdl> <format>              Read a record with key
  1275.         READF   <hdl> <format>              Read the first record
  1276.         READL   <hdl> <format>              Read the last record
  1277.         READP   <hdl> <format>              Read the previous record
  1278.         READN   <hdl> <format>              Read the next record
  1279.         WRITE   <hdl> <format>              Write record with key
  1280.  
  1281.  
  1282.     Creating dBase files
  1283.     --------------------
  1284.  
  1285.       The CREATE command is used to create a dBase file if it does not
  1286.     exist. If the file already exist, CREATE will return an error (leaving
  1287.     the disk file alone).
  1288.  
  1289.       If the CREATE command does not result in an error, the file will be
  1290.     opened using the provided handle. The record pointer will be positioned
  1291.     to the first record in the file.
  1292.  
  1293.       ...
  1294.       ...
  1295.       FORMAT InvDetail rnbr rline
  1296.         rnbr        ;invoice #  (1st part of key)
  1297.         rline       ;invoice line item number (last part of key)
  1298.         ritm        ;inventory item # for this line item
  1299.         rqty        ;quantity ordered for this line item
  1300.         rprice      ;each price of this line item
  1301.         rdisc       ;discount percent for this line item
  1302.         rupdate     ;update flag for this record
  1303.       FORMAT
  1304.       ...
  1305.       ...
  1306.       create 1 InvDetail J:\AR\DATA\R1B         ;try to create file
  1307.       if @file_stat@ != "*OK*"                  ;chk for err
  1308.         text  "Cannot create J:\AR\DATA\R1B."   ; report error
  1309.         force_enter                             ; make 'em press enter
  1310.         exit all                                ; exit
  1311.       endif                                     ;
  1312.       ...
  1313.  
  1314.  
  1315.     Opening dBase files
  1316.     -------------------
  1317.  
  1318.       The OPEN command is used to open a currently existing dBase file. If
  1319.     the file does not exist, OPEN will return an error (leaving the disk
  1320.     file alone). If the OPEN command does not result in an error, the record
  1321.     pointer will be positioned to the first record in the file.
  1322.  
  1323.       ...
  1324.       open 1 InvDetail J:\AR\DATA\R1B           ;try to open file
  1325.       if @file_stat@ != "*OK*"                  ;chk for err
  1326.         text  "Cannot open J:\AR\DATA\R1B."     ; report error
  1327.         force_enter                             ; make 'em press enter
  1328.         exit all                                ; exit
  1329.       endif                                     ;
  1330.       ...
  1331.  
  1332.  
  1333.     Reading dBase files
  1334.     -------------------
  1335.  
  1336.       The READ command is used to read a specified record from a dBase file.
  1337.     If the specified key is not on file, an error is returned. Otherwise,
  1338.     the fields in the specified FORMAT block are loaded with the data from
  1339.     the READ.
  1340.  
  1341.       The key that is used to read the data file is built from the key
  1342.     fields in the specified FORMAT. For example, in the "HistFmt" defined
  1343.     above the field "Name" is the key field. The FORMAT "InvDetail" (above)
  1344.     will build the key from two fields: "rnbr" and "rline".
  1345.  
  1346.       read 1 HistFmt                ;read caller hist file for this caller
  1347.       if @file_stat@ == "*OK*"      ;was it found?
  1348.         set wasnew N                ;
  1349.         gosub Listit                ; yes; display and prompt
  1350.       else                          ;
  1351.         set wasnew Y                ;
  1352.         gosub NewCaller             ;
  1353.       endif                         ;not found, new caller
  1354.  
  1355.  
  1356.       There are four other commands that perform read type functions on
  1357.     dBase files: READF, READL, READP and READN. These commands read the
  1358.     first, last, previous and next records (respectivly) in a dBase file.
  1359.  
  1360.  
  1361.     Writing dBase files
  1362.     -------------------
  1363.  
  1364.       The WRITE command is used to write a record to a dBase file. The key
  1365.     that is used to write the record is built from the key fields in the
  1366.     specified FORMAT. For example, in the "HistFmt" defined above the field
  1367.     "Name" is the key field. The FORMAT "InvDetail" (above) will build the
  1368.     key from two fields: "rnbr" and "rline".
  1369.  
  1370.       If the key that is formed is currently on file, it's record is over-
  1371.     written with the new record data. If the key is not on file, the key and
  1372.     record are added to the file.
  1373.  
  1374.  
  1375.     Techiques
  1376.     ---------
  1377.  
  1378.       A common need in most programming is control record processing. Let's
  1379.     say you're writing an order processing door. You need to store the order
  1380.     number in a control file so that it can be read for new orders, and
  1381.     updated after an order is placed.
  1382.  
  1383.       FIELDS
  1384.         ivcKey    C   5    0    0  *
  1385.       FIELDS
  1386.       ...
  1387.       FORMAT InvCtrl ivcKey
  1388.         ivcKey      ;invoice # control record key
  1389.         rnbr        ;invoice #
  1390.       FORMAT
  1391.       ...
  1392.       ...
  1393.       open 1 InvCtrl J:\AR\DATA\R1CTRL    ;try to open control file
  1394.       if @file_stat@ != "*OK*"            ;chk for error
  1395.         goto fatalError                   ; exit script if error
  1396.       endif                               ;control file is now open
  1397.       set ivcKey "RNBR"                   ;set record key to read
  1398.       read 1 InvCtrl                      ;read control record
  1399.       if @file_stat@ != "*OK*"            ;chk for error
  1400.         goto fatalError                   ; exit script if error
  1401.       endif                               ;
  1402.       ;
  1403.       ; the field 'rnbr' now contains the value read from the control
  1404.       ; file 'J:\AR\DATA\R1CTRL' using a key of "RNBR".
  1405.       ;
  1406.       ...
  1407.       ...
  1408.       ...
  1409.       ;
  1410.       ; add 1 to the order # and update the control file
  1411.       ;
  1412.       inc rnbr                            ;increment 'rnbr' field by 1
  1413.       set ivcKey "RNBR"                   ;set record key to write
  1414.       write 1 InvCtrl                     ;write control record
  1415.       if @file_stat@ != "*OK*"            ;chk for error
  1416.         goto fatalError                   ; exit script if error
  1417.       endif                               ;
  1418.       close 1                             ;close the file
  1419.  
  1420.  
  1421.     Technical Notes
  1422.     ----------------
  1423.  
  1424.       The dBase files that are maintained by PCBSuperScript are comprised of
  1425.     two files: the data file and the index file. The name of the data file
  1426.     will be the file name specified with an extension of ".DBF". The index
  1427.     file will have an extension of ".NDX". For example, if you used the
  1428.     CREATE command to create a file named "SALES", PCBSuperScript would
  1429.     create a file named "SALES.DBF" and a file named "SALES.NDX". The OPEN
  1430.     command also expects this file naming structure.
  1431.  
  1432.       The record key is defined in the format statement as a list of
  1433.     record variables that comprise the key. Therefore, you cannot have a
  1434.     variable as part of the key if it is not part of the data record. This
  1435.     will sometimes mean that you have to include a variable in the data
  1436.     record that you don't "really" need as part of the record. But this also
  1437.     means that if the index file is ever damaged it can be easily
  1438.     reconstructed.
  1439.  
  1440.       The key that PCBSuperScript builds from the data record is NOT case
  1441.     sensitive. The dBase key expression used is:
  1442.  
  1443.         UPPER(var1)+UPPER(var2)+....UPPER(varN)
  1444.  
  1445.       If the field is a numeric, the expression would be "UPPER(STR(varN))".
  1446.  
  1447.       When PCBSuperScript is building the key, the variable(s) used are
  1448.     padded with spaces to their defined lengths before forming the key.
  1449.  
  1450.       NOTE:     The above case conversions and padding occurs internally. NO
  1451.                 modifications are made to the variables defined in the
  1452.                 format.
  1453.  
  1454.  
  1455.  
  1456.   Date/Time Commands
  1457.   ──────────────────────────────────────────────────────────────────────────
  1458.  
  1459.       The date/time commands provide your script with the ability to
  1460.     retrieve the date and time in a variety of formats. They also allow easy
  1461.     addition and subtraction of date fields.
  1462.  
  1463.       The command CURTIME will return the current time in one of six
  1464.     formats.
  1465.  
  1466.         Command:  CURTIME <type> <var>
  1467.  
  1468.           Parms:  type      0   05:58:48.26
  1469.                             1   05:58:48
  1470.                             2   5:58 AM
  1471.                             3   5:58a
  1472.                             4   5:58
  1473.                             5   05:58
  1474.                   var       The name of the variable to store the time in.
  1475.  
  1476.         Example:  CURTIME 1 xtime         ;xtime = "05:58:48"
  1477.                   CURTIME 3 xtime         ;xtime = "5:58a"
  1478.                   CURTIME 4 xtime         ;xtime = "5:58"
  1479.  
  1480.  
  1481.       The command CURDATE will return the current date in one of thirteen
  1482.     formats. The <sep> parameter is the character used as a 'seperator' if
  1483.     the date format requires one. For example, using format type 5, there is
  1484.     a seperator between 'mm', 'dd' and 'yy' (i.e. 'mm-dd-yy').
  1485.  
  1486.         Command:  CURDATE <type> <sep> <var>
  1487.  
  1488.           Parms:  type      0   Tuesday  March 14, 1992
  1489.                             1   Tue  March 14, 1992
  1490.                             2   March 14, 1992
  1491.                             3   14 Mar 92
  1492.                             4   m-d-yy
  1493.                             5   mm-dd-yy
  1494.                             6   d-m-yy
  1495.                             7   dd-mm-yy
  1496.                             8   yy-m-d
  1497.                             9   yy-mm-dd
  1498.                            10   m-d-yyyy
  1499.                            11   mm-dd-yyyy
  1500.                            12   mmddyy
  1501.                            13   yymmdd
  1502.  
  1503.                   sep       The seperator character used in types 4-11.
  1504.  
  1505.                   var       The name of the variable to store the time in.
  1506.  
  1507.  
  1508.         Example:  CURDATE 1  '/' xdate    ;xdate = "Tue  March 14, 1992"
  1509.                   CURDATE 4  '/' xdate    ;xdate = "3/14/92"
  1510.                   CURDATE 11 '-' xdate    ;xdate = "03-14-1992"
  1511.  
  1512.  
  1513.       The command DATEADD will add the specified number of days to a date
  1514.     field. The date field that is being added to *must* be in 'mm-dd-yy'
  1515.     format (CURDATE format #5). The seperator character you use is not
  1516.     important.
  1517.  
  1518.         Command:  DATEADD   <date> <days> <var>
  1519.  
  1520.           Parms:  date      The date to add to.
  1521.                   days      The number of days to add
  1522.                   var       The name of the variable to store the date in.
  1523.  
  1524.         Example:  CURDATE 5  '/' xdate      ;xdate = "03/14/92"
  1525.                   DATEADD xdate 30 xdate    ;xdate = xdate + 30 days
  1526.  
  1527.  
  1528.       The command DATEADDM will add the specified number of months to a date
  1529.     field. The date field that is being added to *must* be in 'mm-dd-yy'
  1530.     format (CURDATE format #5). The seperator character you use is not
  1531.     important.
  1532.  
  1533.       If the result of the addition is an invalid day for the month, the day
  1534.     will be set equal to the highest allowable day for that month. For
  1535.     example, if you add 1 month to 01-30-92 the result is 02-30-92. Since
  1536.     February does not have 30 days, it will be adjusted to 02-29-92 (leap
  1537.     year is detected and accounted for).
  1538.  
  1539.         Command:  DATEADDM  <date> <months> <var>
  1540.  
  1541.           Parms:  date      The date to add to.
  1542.                   months    The number of months to add
  1543.                   var       The name of the variable to store the date in.
  1544.  
  1545.         Example:  CURDATE 5  '/' xdate      ;xdate = "03/14/92"
  1546.                   DATEADDM xdate 1 xdate    ;xdate = "04/14/92"
  1547.  
  1548.                   CURDATE 5  '/' xdate      ;xdate = "12/14/91"
  1549.                   DATEADDM xdate 1 xdate    ;xdate = "01/14/92"
  1550.  
  1551.                   CURDATE 5  '/' xdate      ;xdate = "08/30/92"
  1552.                   DATEADDM xdate 6 xdate    ;xdate = "02/28/93" <- note day
  1553.  
  1554.  
  1555.  
  1556.       The command DATESUB will subtract the specified number of days from a
  1557.     date field. The date field that is being subtracted from *must* be in
  1558.     'mm-dd-yy' format (CURDATE format #5). The seperator character you use
  1559.     is not important.
  1560.  
  1561.         Command:  DATESUB   <date> <days> <var>
  1562.  
  1563.           Parms:  date      The date to add to.
  1564.                   days      The number of days to subtract.
  1565.                   var       The name of the variable to store the date in.
  1566.  
  1567.         Example:  CURDATE 5  '/' xdate      ;xdate = "03/14/92"
  1568.                   DATESUB xdate 30 xdate    ;xdate = xdate - 30 days
  1569.  
  1570.  
  1571.       The command DATESUBM will subtract the specified number of months from
  1572.     a date field. The date field that is being subtracted from *must* be in
  1573.     'mm-dd-yy' format (CURDATE format #5). The seperator character you use
  1574.     is not important.
  1575.  
  1576.       If the subtraction results in an invalid day for the month, the day
  1577.     will be set equal to the highest allowable day for that month. For
  1578.     example, if you subtract 1 month from 03-30-92 the result is 02-30-92.
  1579.     Since February does not have 30 days, it will be adjusted to 02-29-92
  1580.     (leap year is detected and accounted for).
  1581.  
  1582.  
  1583.         Command:  DATESUBM  <date> <months> <var>
  1584.  
  1585.           Parms:  date      The date to add to.
  1586.                   months    The number of months to subtract.
  1587.                   var       The name of the variable to store the date in.
  1588.  
  1589.         Example:  CURDATE 5  '/' xdate      ;xdate = "03/14/92"
  1590.                   DATESUBM xdate 1 xdate    ;xdate = "02/14/92"
  1591.  
  1592.                   CURDATE 5  '/' xdate      ;xdate = "01/14/92"
  1593.                   DATESUBM xdate 1 xdate    ;xdate = "12/14/91"
  1594.  
  1595.                   CURDATE 5  '/' xdate      ;xdate = "03/31/92"
  1596.                   DATESUBM xdate 1 xdate    ;xdate = "02/29/92" <- note day
  1597.  
  1598.  
  1599.  
  1600.       The command DATEDIF will return the number of days between two date
  1601.     fields. Both date fields *must* be in 'mm-dd-yy' format (CURDATE format
  1602.     #5). The seperator character you use is not important.
  1603.  
  1604.         Command:  DATEDIF   <date1> <date2> <var>
  1605.  
  1606.           Parms:  date1     Date string 1.
  1607.                   date2     Date string 2.
  1608.                   var       The name of the variable to store the date in.
  1609.  
  1610.         Example:  CURDATE 5  '/' xdate1       ;xdate1 = "03/14/92"
  1611.                   DATEADD xdate1 30 xdate2    ;xdate2 = xdate1 + 30 days
  1612.                   DATEDIF xdate1 xdate2 xdif  ;xdif = xdate1 - xdate2
  1613.  
  1614.  
  1615.   Callback Commands
  1616.   ───────────────────────────────────────────────────────────────────────────
  1617.       SENDMODEM  <waitsec> <cmnd>
  1618.       PARSEPHONE <phone#> <area> <exchg> <number>
  1619.       CALLBACK   <waitsec> <ATDT + phone #>
  1620.  
  1621.  
  1622.   Caller Data Modification
  1623.   ───────────────────────────────────────────────────────────────────────────
  1624.  
  1625.     UPDATE_USER_RECORD
  1626.  
  1627.       The SET command, math commands and date/time commands can be used to
  1628.     modify fields in the caller's record. The fields that can be modified
  1629.     are:
  1630.  
  1631.       @city@            City
  1632.       @comment1@        Comment line 1
  1633.       @comment2@        Comment line 2
  1634.       @dataphone@       Business/Data Phone
  1635.       @daybytes@        Daily D/L Bytes
  1636.       @dlbytes@         Total D/L Bytes
  1637.       @dlfiles@         Total D/L Files
  1638.       @expdate@         Expiration Date
  1639.       @expertmode@      Expert mode
  1640.       @homephone@       Home/Voice Phone
  1641.       @pagelen@         Page length setting
  1642.       @password@        User password
  1643.       @proltr@          Default Protocol Letter
  1644.       @security@        Security Level
  1645.       @upbytes@         Total U/L Bytes
  1646.       @upfiles@         Total U/L Files
  1647.  
  1648.  
  1649.     Examples:
  1650.       SET @proltr@ 'Z'                ;change default protocol to zmodem
  1651.       SET @security@ 10               ;change security level to 10
  1652.       INC @dlfiles@                   ;add 1 to Total D/L Files
  1653.       DATEADDM @expdate@ 1 @expdate@  ;add 1 month to the expire date
  1654.                                       ; of the caller
  1655.  
  1656.     If you need to change the available online time, use the ADJTIME
  1657.   command. This command will add or subtract a specified number of minutes
  1658.   from the callers remaining online time.
  1659.  
  1660.     Examples:
  1661.  
  1662.       ADJTIME ADD 10  ;add 10 minutes to the callers online time
  1663.       ADJTIME SUB 10  ;subtract 10 minutes from the callers online time
  1664.  
  1665.  
  1666.  
  1667.     To check the caller status in a conference use the GETCINFO command.
  1668.   This command will check a specified flag in the specified conference
  1669.   number. For example, the following example will set 'isCnfReg' to '0' if
  1670.   the caller is NOT registered in conference #1. If the caller IS
  1671.   registered in conference #1, 'isCnfReg' is set to '1'.
  1672.  
  1673.       GETCINFO 1 REGISTERED isCnfReg
  1674.  
  1675.  
  1676.     To set the caller status in a conference use the SETCINFO command.
  1677.   This command will set a specified flag in the specified conference
  1678.   number. For example, the following example will set the REGISTERED flag in
  1679.   the conference record for the caller:
  1680.  
  1681.       SETCINFO 1 REGISTERED TRUE
  1682.  
  1683.  
  1684.  
  1685.   Math Funtions
  1686.   ───────────────────────────────────────────────────────────────────────────
  1687.  
  1688.       These commands provide basic functions. See SSREF.DOC for a discussion
  1689.     of each.
  1690.  
  1691.       ADD <var> <val1> <val2>
  1692.       SUB <var> <val1> <val2>
  1693.       MUL <var> <val1> <val2>
  1694.       DIV <var> <val1> <val2>
  1695.       INC <var>
  1696.       DEC <var>
  1697.  
  1698.  
  1699.   Display Funtions
  1700.   ───────────────────────────────────────────────────────────────────────────
  1701.  
  1702.       These commands provide basic functions. See SSREF.DOC for a discussion
  1703.     of each.
  1704.  
  1705.       DISPLAY       <row> <col> <..data..>
  1706.       DISPLAYC      <row> <..data..>
  1707.       DISPLAY_FILE  <file>
  1708.       GOTORC        <row> <col>
  1709.       INDENT        <cols>
  1710.       REPEAT        <row> <col> <char> <cnt>
  1711.       TEXT          <..data..>
  1712.  
  1713.  
  1714.   Display Control Funtions
  1715.   ───────────────────────────────────────────────────────────────────────────
  1716.       CLEARCRT
  1717.       CLEARLINES        <row1> <row2>
  1718.       COLOR             [BRIGHT] <fcolor> [BLINK] <bcolor>
  1719.       ENTRY_MIN_CHAR    <char>
  1720.       ENTRY_MIN_ATTR    [BRIGHT] <fcolor> [BLINK] <bcolor>
  1721.       ENTRY_MAX_CHAR    <char>
  1722.       ENTRY_MAX_ATTR    [BRIGHT] <fcolor> [BLINK] <bcolor>
  1723.       ENTRY_ANS_ATTR    [BRIGHT] <fcolor> [BLINK] <bcolor>
  1724.       NEWLINE           <count>
  1725.  
  1726.  
  1727.   String Funtions
  1728.   ───────────────────────────────────────────────────────────────────────────
  1729.       RANDOM_STR    <count> <var>
  1730.       SET           <var> <val>
  1731.       TRIMR         <var> [<var>...<var>]
  1732.       TRIML         <var> [<var>...<var>]
  1733.       TRIM          <var> [<var>...<var>]
  1734.       LCASE         <var> [<var>...<var>]
  1735.       UCASE         <var> [<var>...<var>]
  1736.       PARSE         <string>
  1737.       GETWORD       <var>
  1738.  
  1739.  
  1740.   Script Flow Control Funtions
  1741.   ───────────────────────────────────────────────────────────────────────────
  1742.       EXIT    <ALL>
  1743.       CALL    <script> <label>
  1744.       RUN     <script> <label>
  1745.  
  1746.  
  1747.   Misc Funtions
  1748.   ───────────────────────────────────────────────────────────────────────────
  1749.       DOS               <cmd>
  1750.       ESET              <evar> <val>
  1751.       FREECORE
  1752.       GOODBYE
  1753.       HANGUP
  1754.       INCLUDE           <file>
  1755.       LOG_MSG           <msg>
  1756.       LOG_DATA          <file>
  1757.       MSG
  1758.       SRCHTXTFILE       <srchtxt> <file>
  1759.       SHELL             <prg> <parms>
  1760.       VALIDCREDITCARD   <card#> <var>
  1761.